<?php
$tdatacities=array();
	$tdatacities[".NumberOfChars"]=80; 
	$tdatacities[".ShortName"]="cities";
	$tdatacities[".OwnerID"]="";
	$tdatacities[".OriginalTable"]="cities";


	
//	field labels
$fieldLabelscities = array();
if(mlang_getcurrentlang()=="English")
{
	$fieldLabelscities["English"]=array();
	$fieldToolTipscities["English"]=array();
	$fieldLabelscities["English"]["id"] = "Id";
	$fieldToolTipscities["English"]["id"] = "";
	$fieldLabelscities["English"]["city_code"] = "Code";
	$fieldToolTipscities["English"]["city_code"] = "";
	$fieldLabelscities["English"]["city_name"] = "Name";
	$fieldToolTipscities["English"]["city_name"] = "";
	$fieldLabelscities["English"]["state_id"] = "State";
	$fieldToolTipscities["English"]["state_id"] = "";
	if (count($fieldToolTipscities["English"])){
		$tdatacities[".isUseToolTips"]=true;
	}
}
if(mlang_getcurrentlang()=="Chinese (Hong Kong S.A.R.)")
{
	$fieldLabelscities["Chinese (Hong Kong S.A.R.)"]=array();
	$fieldToolTipscities["Chinese (Hong Kong S.A.R.)"]=array();
	$fieldLabelscities["Chinese (Hong Kong S.A.R.)"]["id"] = "Id";
	$fieldToolTipscities["Chinese (Hong Kong S.A.R.)"]["id"] = "";
	$fieldLabelscities["Chinese (Hong Kong S.A.R.)"]["city_code"] = "City Code";
	$fieldToolTipscities["Chinese (Hong Kong S.A.R.)"]["city_code"] = "";
	$fieldLabelscities["Chinese (Hong Kong S.A.R.)"]["city_name"] = "City Name";
	$fieldToolTipscities["Chinese (Hong Kong S.A.R.)"]["city_name"] = "";
	$fieldLabelscities["Chinese (Hong Kong S.A.R.)"]["state_id"] = "State Id";
	$fieldToolTipscities["Chinese (Hong Kong S.A.R.)"]["state_id"] = "";
	if (count($fieldToolTipscities["Chinese (Hong Kong S.A.R.)"])){
		$tdatacities[".isUseToolTips"]=true;
	}
}
if(mlang_getcurrentlang()=="Chinese (Taiwan)")
{
	$fieldLabelscities["Chinese (Taiwan)"]=array();
	$fieldToolTipscities["Chinese (Taiwan)"]=array();
	$fieldLabelscities["Chinese (Taiwan)"]["id"] = "Id";
	$fieldToolTipscities["Chinese (Taiwan)"]["id"] = "";
	$fieldLabelscities["Chinese (Taiwan)"]["city_code"] = "City Code";
	$fieldToolTipscities["Chinese (Taiwan)"]["city_code"] = "";
	$fieldLabelscities["Chinese (Taiwan)"]["city_name"] = "City Name";
	$fieldToolTipscities["Chinese (Taiwan)"]["city_name"] = "";
	$fieldLabelscities["Chinese (Taiwan)"]["state_id"] = "State Id";
	$fieldToolTipscities["Chinese (Taiwan)"]["state_id"] = "";
	if (count($fieldToolTipscities["Chinese (Taiwan)"])){
		$tdatacities[".isUseToolTips"]=true;
	}
}
if(mlang_getcurrentlang()=="French")
{
	$fieldLabelscities["French"]=array();
	$fieldToolTipscities["French"]=array();
	$fieldLabelscities["French"]["id"] = "Id";
	$fieldToolTipscities["French"]["id"] = "";
	$fieldLabelscities["French"]["city_code"] = "City Code";
	$fieldToolTipscities["French"]["city_code"] = "";
	$fieldLabelscities["French"]["city_name"] = "City Name";
	$fieldToolTipscities["French"]["city_name"] = "";
	$fieldLabelscities["French"]["state_id"] = "State Id";
	$fieldToolTipscities["French"]["state_id"] = "";
	if (count($fieldToolTipscities["French"])){
		$tdatacities[".isUseToolTips"]=true;
	}
}


	
	$tdatacities[".NCSearch"]=true;

	

$tdatacities[".shortTableName"] = "cities";
$tdatacities[".nSecOptions"] = 0;
$tdatacities[".recsPerRowList"] = 1;	
$tdatacities[".tableGroupBy"] = "0";
$tdatacities[".mainTableOwnerID"] = "";
$tdatacities[".moveNext"] = 1;




$tdatacities[".showAddInPopup"] = false;

$tdatacities[".showEditInPopup"] = false;

$tdatacities[".showViewInPopup"] = false;


$tdatacities[".fieldsForRegister"] = array();

$tdatacities[".listAjax"] = true;

	$tdatacities[".audit"] = false;

	$tdatacities[".locking"] = false;
	
$tdatacities[".listIcons"] = true;
$tdatacities[".edit"] = true;
$tdatacities[".inlineEdit"] = true;
$tdatacities[".view"] = true;

$tdatacities[".exportTo"] = true;

$tdatacities[".printFriendly"] = true;

$tdatacities[".delete"] = true;

$tdatacities[".showSimpleSearchOptions"] = true;

$tdatacities[".showSearchPanel"] = true;


$tdatacities[".isUseAjaxSuggest"] = true;

$tdatacities[".rowHighlite"] = true;


// button handlers file names

$tdatacities[".addPageEvents"] = false;

$tdatacities[".arrKeyFields"][] = "id";

// use datepicker for search panel
$tdatacities[".isUseCalendarForSearch"] = false;

// use timepicker for search panel
$tdatacities[".isUseTimeForSearch"] = false;

$tdatacities[".isUseiBox"] = false;


$tdatacities[".useDetailsPreview"] = true;	

$tdatacities[".isUseInlineAdd"] = true;

$tdatacities[".isUseInlineEdit"] = true;
$tdatacities[".isUseInlineJs"] = $tdatacities[".isUseInlineAdd"] || $tdatacities[".isUseInlineEdit"];

$tdatacities[".allSearchFields"] = array();

$tdatacities[".globSearchFields"][] = "id";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("id", $tdatacities[".allSearchFields"]))
{
	$tdatacities[".allSearchFields"][] = "id";	
}
$tdatacities[".globSearchFields"][] = "city_code";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("city_code", $tdatacities[".allSearchFields"]))
{
	$tdatacities[".allSearchFields"][] = "city_code";	
}
$tdatacities[".globSearchFields"][] = "city_name";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("city_name", $tdatacities[".allSearchFields"]))
{
	$tdatacities[".allSearchFields"][] = "city_name";	
}
$tdatacities[".globSearchFields"][] = "state_id";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("state_id", $tdatacities[".allSearchFields"]))
{
	$tdatacities[".allSearchFields"][] = "state_id";	
}


$tdatacities[".googleLikeFields"][] = "id";
$tdatacities[".googleLikeFields"][] = "city_code";
$tdatacities[".googleLikeFields"][] = "city_name";
$tdatacities[".googleLikeFields"][] = "state_id";



$tdatacities[".advSearchFields"][] = "id";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("id", $tdatacities[".allSearchFields"])) 
{
	$tdatacities[".allSearchFields"][] = "id";	
}
$tdatacities[".advSearchFields"][] = "city_code";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("city_code", $tdatacities[".allSearchFields"])) 
{
	$tdatacities[".allSearchFields"][] = "city_code";	
}
$tdatacities[".advSearchFields"][] = "city_name";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("city_name", $tdatacities[".allSearchFields"])) 
{
	$tdatacities[".allSearchFields"][] = "city_name";	
}
$tdatacities[".advSearchFields"][] = "state_id";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("state_id", $tdatacities[".allSearchFields"])) 
{
	$tdatacities[".allSearchFields"][] = "state_id";	
}

$tdatacities[".isTableType"] = "list";


	

$tdatacities[".isDisplayLoading"] = true;

$tdatacities[".isResizeColumns"] = false;

	$tdatacities[".subQueriesSupAccess"] = true;




$tdatacities[".pageSize"] = 20;

$gstrOrderBy = "";
if(strlen($gstrOrderBy) && strtolower(substr($gstrOrderBy,0,8))!="order by")
	$gstrOrderBy = "order by ".$gstrOrderBy;
$tdatacities[".strOrderBy"] = $gstrOrderBy;
	
$tdatacities[".orderindexes"] = array();

$tdatacities[".sqlHead"] = "SELECT id,   city_code,   city_name,   state_id";
$tdatacities[".sqlFrom"] = "FROM cities";
$tdatacities[".sqlWhereExpr"] = "";
$tdatacities[".sqlTail"] = "";




//fill array of records per page for list and report without group fields
$arrRPP = array();
$arrRPP[] = 10;
$arrRPP[] = 20;
$arrRPP[] = 30;
$arrRPP[] = 50;
$arrRPP[] = 100;
$arrRPP[] = 500;
$arrRPP[] = -1;
$tdatacities[".arrRecsPerPage"] = $arrRPP;

//fill array of groups per page for report with group fields
$arrGPP = array();
$arrGPP[] = 1;
$arrGPP[] = 3;
$arrGPP[] = 5;
$arrGPP[] = 10;
$arrGPP[] = 50;
$arrGPP[] = 100;
$arrGPP[] = -1;
$tdatacities[".arrGroupsPerPage"] = $arrGPP;

	$tableKeys = array();
	$tableKeys[] = "id";
	$tdatacities[".Keys"] = $tableKeys;

//	id
	$fdata = array();
	$fdata["strName"] = "id";
	$fdata["ownerTable"] = "cities";
		$fdata["Label"]="Id"; 
	
		
		
	$fdata["FieldType"]= 3;
	
		$fdata["AutoInc"]=true;
	
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "id";
	
		$fdata["FullName"]= "id";
	
		$fdata["IsRequired"]=true; 
	
		
		
		
		
				$fdata["Index"]= 1;
				$fdata["EditParams"]="";
			
		$fdata["bListPage"]=true; 
	
		
		
		
		
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
				$fdata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");	
						$fdata["validateAs"]["basicValidate"][] = "IsRequired";
	
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacities["id"]=$fdata;
//	city_code
	$fdata = array();
	$fdata["strName"] = "city_code";
	$fdata["ownerTable"] = "cities";
		$fdata["Label"]="Code"; 
	
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "city_code";
	
		$fdata["FullName"]= "city_code";
	
		
		
		
		
		
				$fdata["Index"]= 2;
				$fdata["EditParams"]="";
			$fdata["EditParams"].= " maxlength=5";
		
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		$fdata["bEditPage"]=true; 
	
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
		
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacities["city_code"]=$fdata;
//	city_name
	$fdata = array();
	$fdata["strName"] = "city_name";
	$fdata["ownerTable"] = "cities";
		$fdata["Label"]="Name"; 
	
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "city_name";
	
		$fdata["FullName"]= "city_name";
	
		
		
		
		
		
				$fdata["Index"]= 3;
				$fdata["EditParams"]="";
			$fdata["EditParams"].= " maxlength=50";
		
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		$fdata["bEditPage"]=true; 
	
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
		
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacities["city_name"]=$fdata;
//	state_id
	$fdata = array();
	$fdata["strName"] = "state_id";
	$fdata["ownerTable"] = "cities";
		$fdata["Label"]="State"; 
	
		
		
	$fdata["FieldType"]= 3;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Lookup wizard";
	$fdata["ViewFormat"]= "";
	
		
		$fdata["LookupType"]=1;
	$fdata["pLookupType"] = 1;
	$fdata["freeInput"] = 0;	
	$fdata["autoCompleteFieldsOnEdit"] = 0;
	$fdata["autoCompleteFields"] = array();
										$fdata["LinkField"]="id";
	$fdata["LinkFieldType"]=3;
	$fdata["DisplayField"]="state_name";
				$fdata["LookupTable"]="states";
	$fdata["LookupOrderBy"]="state_name";
																$fdata["AllowToAdd"]=true; 
				
					
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "state_id";
	
		$fdata["FullName"]= "state_id";
	
		$fdata["IsRequired"]=true; 
	
		
		
		
		
				$fdata["Index"]= 4;
				
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		$fdata["bEditPage"]=true; 
	
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
						$fdata["validateAs"]["basicValidate"][] = "IsRequired";
	
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacities["state_id"]=$fdata;

	
$tables_data["cities"]=&$tdatacities;
$field_labels["cities"] = &$fieldLabelscities;
$fieldToolTips["cities"] = &$fieldToolTipscities;

// -----------------start  prepare master-details data arrays ------------------------------//
// tables which are detail tables for current table (master)
$detailsTablesData["cities"] = array();
$dIndex = 1-1;
			$strOriginalDetailsTable="brcs";
	$detailsTablesData["cities"][$dIndex] = array(
		  "dDataSourceTable"=>"brcs"
		, "dOriginalTable"=>$strOriginalDetailsTable
		, "dShortTable"=>"brcs"
		, "masterKeys"=>array()
		, "detailKeys"=>array()
		, "dispChildCount"=> "1"
		, "hideChild"=>"0"
		, "sqlHead"=>"SELECT id,  bank_id,  account_id,  ra_id,  signature,  designation,  office_address,  residential_address,  place,  brc_date,  ref_id,  \"\" AS bank_address,  \"\" AS account_address,  \"\" AS ra_address"	
		, "sqlFrom"=>"FROM brcs"	
		, "sqlWhere"=>""
		, "sqlTail"=>""
		, "groupBy"=>"0"
		, "previewOnList" => 1
		, "previewOnAdd" => 0
		, "previewOnEdit" => 0
		, "previewOnView" => 0
	);	
		$detailsTablesData["cities"][$dIndex]["masterKeys"][]="id";
		$detailsTablesData["cities"][$dIndex]["detailKeys"][]="place";


	
// tables which are master tables for current table (detail)
$masterTablesData["cities"] = array();

// -----------------end  prepare master-details data arrays ------------------------------//

require_once(getabspath("classes/sql.php"));










$proto598=array();
$proto598["m_strHead"] = "SELECT";
$proto598["m_strFieldList"] = "id,   city_code,   city_name,   state_id";
$proto598["m_strFrom"] = "FROM cities";
$proto598["m_strWhere"] = "";
$proto598["m_strOrderBy"] = "";
$proto598["m_strTail"] = "";
$proto599=array();
$proto599["m_sql"] = "";
$proto599["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto599["m_column"]=$obj;
$proto599["m_contained"] = array();
$proto599["m_strCase"] = "";
$proto599["m_havingmode"] = "0";
$proto599["m_inBrackets"] = "0";
$proto599["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto599);

$proto598["m_where"] = $obj;
$proto601=array();
$proto601["m_sql"] = "";
$proto601["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto601["m_column"]=$obj;
$proto601["m_contained"] = array();
$proto601["m_strCase"] = "";
$proto601["m_havingmode"] = "0";
$proto601["m_inBrackets"] = "0";
$proto601["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto601);

$proto598["m_having"] = $obj;
$proto598["m_fieldlist"] = array();
						$proto603=array();
			$obj = new SQLField(array(
	"m_strName" => "id",
	"m_strTable" => "cities"
));

$proto603["m_expr"]=$obj;
$proto603["m_alias"] = "";
$obj = new SQLFieldListItem($proto603);

$proto598["m_fieldlist"][]=$obj;
						$proto605=array();
			$obj = new SQLField(array(
	"m_strName" => "city_code",
	"m_strTable" => "cities"
));

$proto605["m_expr"]=$obj;
$proto605["m_alias"] = "";
$obj = new SQLFieldListItem($proto605);

$proto598["m_fieldlist"][]=$obj;
						$proto607=array();
			$obj = new SQLField(array(
	"m_strName" => "city_name",
	"m_strTable" => "cities"
));

$proto607["m_expr"]=$obj;
$proto607["m_alias"] = "";
$obj = new SQLFieldListItem($proto607);

$proto598["m_fieldlist"][]=$obj;
						$proto609=array();
			$obj = new SQLField(array(
	"m_strName" => "state_id",
	"m_strTable" => "cities"
));

$proto609["m_expr"]=$obj;
$proto609["m_alias"] = "";
$obj = new SQLFieldListItem($proto609);

$proto598["m_fieldlist"][]=$obj;
$proto598["m_fromlist"] = array();
												$proto611=array();
$proto611["m_link"] = "SQLL_MAIN";
			$proto612=array();
$proto612["m_strName"] = "cities";
$proto612["m_columns"] = array();
$proto612["m_columns"][] = "id";
$proto612["m_columns"][] = "city_code";
$proto612["m_columns"][] = "city_name";
$proto612["m_columns"][] = "state_id";
$obj = new SQLTable($proto612);

$proto611["m_table"] = $obj;
$proto611["m_alias"] = "";
$proto613=array();
$proto613["m_sql"] = "";
$proto613["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto613["m_column"]=$obj;
$proto613["m_contained"] = array();
$proto613["m_strCase"] = "";
$proto613["m_havingmode"] = "0";
$proto613["m_inBrackets"] = "0";
$proto613["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto613);

$proto611["m_joinon"] = $obj;
$obj = new SQLFromListItem($proto611);

$proto598["m_fromlist"][]=$obj;
$proto598["m_groupby"] = array();
$proto598["m_orderby"] = array();
$obj = new SQLQuery($proto598);

$queryData_cities = $obj;
$tdatacities[".sqlquery"] = $queryData_cities;

$tableEvents["cities"] = new eventsBase;

?>
